﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using PhoneToolsDemoApp.Resources;
using PhoneTools = SteveSyrell.Tools.Phone;

namespace PhoneToolsDemoApp
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            PhoneTools.LiveTiles.LiveTileHelper.CreateTile(
                new Uri("/MainPage.xaml?id=" + Guid.NewGuid().ToString(), UriKind.Relative),
                new PhoneTools.LiveTiles.FlipTileData()
                {
                    SmallTileUI = new LiveTileControls.SmallTileControl("MY SMALL TILE"),
                    MediumTileFrontUI = new LiveTileControls.MediumFlipTileControl("MY MEDIUM TILE FRONT"),
                    MediumTileBackUI = new LiveTileControls.MediumFlipTileControl("MY MEDIUM TILE BACK"),
                    WideTileFrontUI = new LiveTileControls.WideFlipTileControl("MY WIDE TILE FRONT"),
                    WideTileBackUI = new LiveTileControls.WideFlipTileControl("MY WIDE TILE BACK")
                });
        }

        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            PhoneTools.LiveTiles.LiveTileHelper.CreateTile(
                new Uri("/MainPage.xaml?id=" + Guid.NewGuid().ToString(), UriKind.Relative),
                new PhoneTools.LiveTiles.CycleTileData()
                {
                    SmallTileUI = new LiveTileControls.SmallTileControl("SMALL CYCLE TILE"),
                    CycleUIs = new UserControl[]
                    {
                        new LiveTileControls.CycleTileControl("Image 1", new SolidColorBrush(Colors.Blue)),
                        new LiveTileControls.CycleTileControl("Image 2", new SolidColorBrush(Colors.Green)),
                        new LiveTileControls.CycleTileControl("Image 3", new SolidColorBrush(Colors.Orange)),
                        new LiveTileControls.CycleTileControl("Image 4", new SolidColorBrush(Colors.Purple)),
                        new LiveTileControls.CycleTileControl("Image 5", new SolidColorBrush(Colors.Magenta))
                    }
                });
        }
    }
}